Usage: Rscript -e " rmarkdown::render( ‘automanualepm.Rmd’, output_file = ‘./automanualepm.html’ )" Usage: R; rmarkdown::render( ‘automanualepm.Rmd’, output_file = ‘./automanualepm.html’ )

EPM analysis corresponding to https://arxiv.org/abs/2309.03980

address review comments for mask sensitivity

Load Data

Note that some manual labels were missing that causes epm =0 downstream. Dropping these for now.

manualdataset <- read.csv( "epmstats/widejoin.csv", na.strings=c(".", "NA", "", "?"), strip.white=TRUE, encoding="UTF-8")
autodataset   <- read.csv("autostats/widejoin.csv", na.strings=c(".", "NA", "", "?"), strip.white=TRUE, encoding="UTF-8")
epmmanualsubset  <- subset(manualdataset, FeatureID == 'epm' & LabelID> 0 & Mean > 0 )  
epmautosubset    <- subset(autodataset  , FeatureID == 'epm' & LabelID> 0 )

merge data frames

UID encodes patient id and time point LabelID is the ROI label

automanualdata = merge(x = epmmanualsubset , y = epmautosubset  , by = c("UID","LabelID"),suffixes=c("man","aut"))
#cbind(as.character(automanualdata$UID),automanualdata$LabelID,automanualdata$Meanman,automanualdata$Meanaut)

analyze

plot and compute correlation

#plot(automanualdata$Mean.x,automanualdata$Mean.y)
fig <- plot_ly(
  automanualdata, x = ~Meanman, y = ~Meanaut,
  # Hover text:
  text = ~paste("UID: ", UID, '<br>LabelID:', LabelID)
  #color = ~carat, size = ~carat
) %>%
  layout(xaxis = list(title = 'Manual'),
         yaxis = list(title = 'Automatic'))

fig
## No trace type specified:
##   Based on info supplied, a 'scatter' trace seems appropriate.
##   Read more about this trace type -> https://plotly.com/r/reference/#scatter
## No scatter mode specifed:
##   Setting the mode to markers
##   Read more about this attribute -> https://plotly.com/r/reference/#scatter-mode
# Pearson correlation between 2 variables
cor(automanualdata$Meanman ,automanualdata$Meanaut)
## [1] 0.8002415